<?php
class inviteapiControl extends skymvc{
	
	public function __construct(){
		parent::__construct();
	}
	/*邀请注册处理函数*/
	public function invite_reg($in_userid){
		if(!isset($_COOKIE['invite_uid'])){
			return false;
		}
		$uid=intval($_COOKIE['invite_uid']);
		M("invite")->insert(array(
			"userid"=>$uid,
			"in_userid"=>$in_userid,
			"dateline"=>time(),
			"money"=>INVITE_MONEY,
			"gold"=>INVITE_GOLD,
			"grade"=>INVITE_GRADE,
		));
		
		$option=array(
			"userid"=>$uid,
			"money"=>$money,
			"content"=>"您邀请了一个朋友，获得了[money]",
			"siteid"=>SITEID,
			"gold"=>INVITE_GOLD,
			"grade"=>INVITE_GRADE,
			"money"=>INVITE_MONEY,
		);
		
		M("user")->addMoney($option);
		 
		
	}
	
	
	
}
?>